<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2018/12/27
 * Time: 14:31
 */
namespace common\sources\read\valueservice;

use common\models\craftsman\ValueService;

class ValueServiceAccess implements IValueServiceAccess
{
    public function getValueServiceByCommodId($task_commod_id)
    {
        return ValueService::find()
                ->select("id,task_id,task_commod_id,return_type,return_type_pepper,interval_time,interval_pepper,pub_timing,pub_timing_pepper,end_timing,chat_type,chat_keys,chat_pepper,exten_period,extend_pepper,buy_sex,
                sex_pepper,praise,praise_keys,praise_pepper,prohibit,prohibit_pepper,buy_age,buy_age_pepper,up_rank,up_rank_pepper,reword_commise,prio_audit,prio_audit_pepper,expre_service,weight,service_pepper,bus_id,
                free_shipping,credit_card,credit_card_pepper")
                ->where(['task_commod_id' => $task_commod_id])
                ->asArray()
                ->one();
    }

    public function getValueServiceReturnType($task_commod_ids)
    {
        return ValueService::find()
            ->select("id,task_id,task_commod_id,return_type,interval_time,pub_timing,end_timing,pub_timing_pepper,praise,chat_keys,chat_pepper,praise_keys,expre_service,
                free_shipping,chat_type,credit_card,credit_card_pepper,extend_pepper,buy_sex,sex_pepper,praise_pepper,reword_commise,buy_age")
            ->where("task_commod_id in  (".$task_commod_ids.")")
            ->asArray()
            ->all();
    }
}